package com.x.Part5_接口.EatableTest;

/**
 * ClassName: EatableTest
 * Package: IntelliJ IDEA
 * Description:
 * Written by HanXu
 * Create 2024.03.05 19:37
 */
public class EatableTest {
    public static void main(String[] args) {

        Eatable[] eatables = new Eatable[2];

        for(int i = 0; i<eatables.length ; i++){
            if(i%2 == 0)
                eatables[i] = new Chinese();
            else
                eatables[i] = new India();
        }


        for(int i = 0; i<eatables.length ; i++){
            eatables[i].eat();
        }


    }
}

interface Eatable{
    public abstract void eat();
}
